class Solution {
public:
    vector<int> findDisappearedNumbers(vector<int>& nums) {
        int n = nums.size();
        vector<int> ret;
        for(int& num : nums)
        {
            int pos = (num - 1) % n;
            if(nums[pos] <= n) nums[pos] += n;
        }
        for(int i = 0; i < n; ++i)
        {
            if(nums[i] <= n)
                ret.emplace_back(i + 1);
        }
        return ret;
    }
};
